﻿#ifndef SENSORORDER_H
#define SENSORORDER_H

#include "utility.h"
#include <QByteArray>
#include <QObject>

class SensorOrder : public QObject {
    Q_OBJECT
public:
    enum UwbInfoStata {
        T0_VALID_BIT   = 0x80,
        T0_TIMEOUT_BIT = 0x40,
        T1_VALID_BIT   = 0x20,
        T1_TIMEOUT_BIT = 0x10,
    };

    enum Pgv100WarningType {
        NOT_PVG_TYPE_QRCODE       = 0x00,  //发现非PGV规格的二维码
        CAMERA_TOO_CLOSE          = 0x01,  //读头离码带太近
        CAMERA_TOO_FAR            = 0x02,  //读头离码带太远
        CAMERA_ROTATE_TOO_BIG     = 0x03,  //读头相对于码带旋转或偏转过大
        CONTRAST_TOO_LOW          = 0x04,  //码的对比度太低
        RESTORE_QRCODE_DETECTED   = 0x05,  //检测到修复码
        TEMPERATURE_TOO_HIGH      = 0x06,  //温度太高
        POSITION_CODE_NEAR_BRANCH = 0x07,  //位置码带靠近在分叉或交叉处
        UNKNOWN_QRCODE            = 0x08,  //发现超过规定的码带
    };
    Q_ENUM( Pgv100WarningType )

    enum Tl740dOutputMode { OUTPUT_MODE_5HZ = 01, OUTPUT_MODE_15HZ = 02, OUTPUT_MODE_25HZ = 03, OUTPUT_MODE_35HZ = 04, OUTPUT_MODE_50HZ = 05, OUTPUT_MODE_100HZ = 06 };

    enum Tl740dBaudRate { BAUD_RATE_9600 = 02, BAUD_RATE_19200 = 03, BAUD_RATE_38400 = 04, BAUD_RATE_115200 = 05 };

    static QByteArray TL740D_setOutputMode( Tl740dOutputMode mode );
    static QByteArray TL740D_setBaudRate( Tl740dBaudRate baudRate );
    static QByteArray TL740D_clearAngle();
    static QByteArray QrcodeReadOrder();
    static QByteArray RFIDReadOrder();
    static QByteArray RFIDStopOrder();
    static QByteArray RFIDStartOrder();
    static QByteArray IoControlReadOrder();

private:
    explicit SensorOrder( QObject* parent = nullptr );
};

#endif  // SENSORORDER_H
